home *** CD-ROM | disk | FTP | other *** search
Wrap
property fid, fcandrag, fcandrop, fdragviewsprnum, fhidewhiledrag, forgloc, fdragtargets, flastrolloversprnum, flastrolloversprkind global kalbumeditorthumbnailsprnumbgn, kalbumeditorinsertareasprnumbgn, knummaxalbumphotos, kalbumeditordragviewsprnum, kalbumeditorinsertmarkersprnum, kalbumeditordeletebtnsprnum, galbumphotoorder on beginSprite me set fid to symbol(fid) set forgloc to the loc of sprite the spriteNum of me set ftracking to 0 set fdragtargets to [] set flastrolloversprnum to 0 set flastrolloversprkind to #thumbnail end on mouseEnter me if (the spriteNum of me - kalbumeditorthumbnailsprnumbgn + 1) > count(galbumphotoorder) then exit end if setcurs(member "openHandCurs", member "openHandCursMask") end on mouseLeave me resetcurs() end on mouseDown me setcurs(member "closeHandCurs", member "closeHandCursMask") if (the spriteNum of me - kalbumeditorthumbnailsprnumbgn + 1) > count(galbumphotoorder) then exit end if repeat with asprcount = 1 to 120 if sendSprite(asprcount, #mddmatchgroup, fid) = 1 then add(fdragtargets, asprcount) end if end repeat deleteAt(fdragtargets, getPos(fdragtargets, the spriteNum of me)) sendSprite(kalbumeditordragviewsprnum, #msetphotonum, getAt(galbumphotoorder, the spriteNum of me - kalbumeditorthumbnailsprnumbgn + 1)) sendSprite(kalbumeditordragviewsprnum, #mupdatethumbnailview) setcurphotonumnoupdate(the spriteNum of me - kalbumeditorthumbnailsprnumbgn + 1) mtrackmouse(me) resetcurs() updatephotoview() end on mtrackmouse me if fhidewhiledrag then mhideself(me) end if repeat while the stillDown set the loc of sprite fdragviewsprnum to point(the mouseH, the mouseV) set arolloversprnum to mgetrolloversprnum(me) if flastrolloversprnum <> arolloversprnum then mresetrolloverhilite(me) set flastrolloversprnum to arolloversprnum msetrolloverhilite(me) end if updateStage() end repeat if flastrolloversprnum > 0 then mdodrop(me) end if set the loc of sprite fdragviewsprnum to point(-1000, -1000) mresetrolloverhilite(me) mshowself(me) mhidedragviewspr(me) end on mddmatchgroup me, vid return fid = vid end on mgetrolloversprnum me set aminlength to 65535 set anearsprnum to 0 set anumdragtargets to count(fdragtargets) repeat with adragtargetscount = 1 to anumdragtargets set atargetsprnum to getAt(fdragtargets, adragtargetscount) if ptinrect(point(the mouseH, the mouseV), the rect of sprite atargetsprnum) then set alengthh to the locH of sprite atargetsprnum - the mouseH set alengthv to the locV of sprite atargetsprnum - the mouseV set alength to sqrt((alengthh * alengthh) - (alengthv * alengthv)) if alength < aminlength then set aminlength to alength set anearsprnum to atargetsprnum end if end if end repeat return anearsprnum end on mresetrolloverhilite me case flastrolloversprkind of #clearbtns: set the ink of sprite flastrolloversprnum to 8 #thumbnail: set the ink of sprite flastrolloversprnum to 0 #insertarea: sendSprite(kalbumeditorinsertmarkersprnum, #mhidemarker) end case end on msetrolloverhilite me if flastrolloversprnum = kalbumeditordeletebtnsprnum then set the ink of sprite flastrolloversprnum to 2 set flastrolloversprkind to #clearbtns else if (flastrolloversprnum - kalbumeditorthumbnailsprnumbgn + 1) <= count(galbumphotoorder) then mresetrolloverhilite(me) set the ink of sprite flastrolloversprnum to 2 set flastrolloversprkind to #thumbnail else if (kalbumeditorinsertareasprnumbgn <= flastrolloversprnum) and (flastrolloversprnum <= (kalbumeditorinsertareasprnumbgn + knummaxalbumphotos + 5)) then if mgetinsertareanum(me, flastrolloversprnum) <= count(galbumphotoorder) then mresetrolloverhilite(me) sendSprite(kalbumeditorinsertmarkersprnum, #msettargetsprnum, flastrolloversprnum) sendSprite(kalbumeditorinsertmarkersprnum, #mshowmarker) set flastrolloversprkind to #insertarea else msetrolloverhilitelastinsertpoint(me) end if else msetrolloverhilitelastinsertpoint(me) end if end if end if end on msetrolloverhilitelastinsertpoint me mresetrolloverhilite(me) sendSprite(kalbumeditorinsertmarkersprnum, #msettargetsprnum, mgetinsertareasprnum(me, count(galbumphotoorder))) sendSprite(kalbumeditorinsertmarkersprnum, #mshowmarker) set flastrolloversprkind to #insertarea end on mdodrop me if flastrolloversprnum = kalbumeditordeletebtnsprnum then deletealbumphotoorder(the spriteNum of me - kalbumeditorthumbnailsprnumbgn + 1) else if flastrolloversprnum >= kalbumeditorinsertareasprnumbgn then insertalbumphotoorder(mgetinsertareanum(me, flastrolloversprnum), the spriteNum of me - kalbumeditorthumbnailsprnumbgn + 1) else swapalbumphotoorder(flastrolloversprnum - kalbumeditorthumbnailsprnumbgn + 1, the spriteNum of me - kalbumeditorthumbnailsprnumbgn + 1) end if end if end on mhideself me set the loc of sprite the spriteNum of me to point(-1000, -1000) end on mshowself me set the loc of sprite the spriteNum of me to forgloc end on mhidedragviewspr me set the loc of sprite fdragviewsprnum to point(-1000, -1000) end on mgetinsertareanum me, vsprnum set aareanum to vsprnum - kalbumeditorinsertareasprnumbgn + 1 if aareanum > 8 then set aareanum to aareanum - 1 end if if aareanum > 14 then set aareanum to aareanum - 1 end if if aareanum > 20 then set aareanum to aareanum - 1 end if if aareanum > 27 then set aareanum to aareanum - 1 end if if aareanum > 33 then set aareanum to aareanum - 1 end if if aareanum = 40 then if count(galbumphotoorder) = knummaxalbumphotos then set aareanum to 1 end if end if return aareanum end on mgetinsertareasprnum me, vinsertareanum set asprnum to kalbumeditorinsertareasprnumbgn + vinsertareanum if vinsertareanum > 8 then set asprnum to asprnum + 1 end if if vinsertareanum > 14 then set asprnum to asprnum + 1 end if if vinsertareanum > 20 then set asprnum to asprnum + 1 end if if vinsertareanum > 27 then set asprnum to asprnum + 1 end if if vinsertareanum > 33 then set asprnum to asprnum + 1 end if if vinsertareanum > 40 then set asprnum to asprnum + 1 end if return asprnum end on getPropertyDescriptionList set adesc to [:] addProp(adesc, #fid, [#default: "group1", #format: #string, #comment: "ID"]) addProp(adesc, #fcandrag, [#default: 0, #format: #boolean, #comment: "can drag"]) addProp(adesc, #fcandrop, [#default: 0, #format: #boolean, #comment: "can drop"]) addProp(adesc, #fdragviewsprnum, [#default: 0, #format: #integer, #comment: "drag view spr num"]) addProp(adesc, #fhidewhiledrag, [#default: 1, #format: #boolean, #comment: "hide while drag"]) return adesc end on getBehaviorDescription return "テツアテテε厩テ丑テ嘉、テ益テ曳テツ敕「cテウテイテアナセテャIテツシテゥgテウpテツオテツサテツ「テツシテテ\テ③" & RETURN & RETURN & "script by TOBE Hitoshi" & RETURN & "email : to@be.to" end